import time
import numpy as np
import json

import mujoco
import mujoco.viewer


class drone:
 def __init__(self):
  self.m = mujoco.MjModel.from_xml_path('mujoco_menagerie-main/skydio_x2/scene.xml')
  self.d = mujoco.MjData(self.m)

 def motor_control(self):
    self.d.ctrl[:16]  = [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
    ]


my_drone = drone()

with mujoco.viewer.launch_passive(my_drone.m, my_drone.d) as viewer:
  time.sleep(50)
  while viewer.is_running():
   my_drone.motor_control()
   mujoco.mj_step(my_drone.m, my_drone.d)
   viewer.sync()
